package com.study.mike.result;

/**
 * @author Kh
 */
//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decom
import org.springframework.lang.NonNull;

public class RUtil {
    public RUtil() {
    }

    public static R success() {
        return new R(Code.SUCCESS.getCode(), Code.SUCCESS.getMsg(), "");
    }

    public static R success(Object data) {
        return new R(Code.SUCCESS.getCode(), Code.SUCCESS.getMsg(), data);
    }

    public static R success(Code code, String message, Object data) {
        return new R(code.getCode(), message, data);
    }

    public static R success(Integer code, String msg, Object data) {
        return new R(code, msg, data);
    }

    public static R fail() {
        return new R(Code.FAIL.getCode(), Code.FAIL.getMsg(), "");
    }

    public static R fail(String msg) {
        return new R(Code.FAIL.getCode(), msg, "");
    }

    public static R fail(String msg, Object data) {
        return new R(Code.FAIL.getCode(), msg, data);
    }

    public static R fail(Integer code, String msg, Object data) {
        return new R(code, msg, data);
    }

    public static R error() {
        return new R(Code.ERROR.getCode(), Code.ERROR.getMsg(), "");
    }

    public static R error(String msg) {
        return new R(Code.ERROR.getCode(), msg, "");
    }

    public static R error(String msg, Object data) {
        return new R(Code.ERROR.getCode(), msg, data);
    }

    public static R error(Integer code, String msg, Object data) {
        return new R(code, msg, data);
    }

    public static R success(@NonNull Code code, Object data) {
        return new R(code.getCode(), code.getMsg(), data);
    }

    public static R fail(@NonNull Code code, Object data) {
        return new R(code.getCode(), code.getMsg(), data);
    }

    public static R error(@NonNull Code code, Object data) {
        return new R(code.getCode(), code.getMsg(), data);
    }
}

